﻿using System.Drawing;
using System.Windows.Forms;
using Ensemble_Windows.Game;
using Ensemble_Windows.Script;
using Ensemble_Windows.UI.TreeView;
using TreeView = Ensemble_Windows.UI.TreeView.TreeView;

namespace EnsembleGame.Form
{
    /// <summary>
    ///     Mod选择界面
    /// </summary>
    public class ModSelect
    {
        /// <summary>
        ///     构造函数
        /// </summary>
        /// <param name="service">游戏服务</param>
        public ModSelect(IService service)
        {
            Service = service;
            TreeView = TreeViewHelper.Create();
            TreeView.CheckBoxes = true;
            TreeView.BackColor = Color.Black;
            TreeView.ForeColor = Color.AliceBlue;
            TreeView.Dock = DockStyle.Fill;
            service.Form.Controls.Add(TreeView);

            ModHelper.FindAllMod(GameConfig.ModPath, GameConfig.LuaStartPath, Service.LuaState);
        }

        private TreeView TreeView { get; set; }

        /// <summary>
        ///     游戏服务
        /// </summary>
        public IService Service { get; set; }
    }
}